package com.ct.lotterysystem2.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ActivityStatusEnum {
    RUNNING(1, "活动进行中"),
    COMPLETED(2, "活动已完成");

    private Integer code;
    private String message;

    public static ActivityStatusEnum forName(String message) {
        for (ActivityStatusEnum activityStatusEnum : ActivityStatusEnum.values()) {
            if (activityStatusEnum.name().equalsIgnoreCase(message)) {
                return activityStatusEnum;
            }
        }
        return null;
    }
}
